<?php

namespace Push\Controller;

use Common\Controller\AdminbaseController;


class AdminPushController extends AdminbaseController {

	public function _initialize(){
		parent::_initialize();
	}
	
	public function index(){
		$push_model = D('push');
		$where		= array();
		$search		= array(
			'receiver' => I('receiver'),
			'type'	   => I('type')
		);
		$search['receiver'] && $where['receiver'] = $search['receiver'];
		$search['type']		&& $where['type']	  = $search['type'];
		$count		= $push_model->where($where)->count();
		$page		= $this->page($count,10);
		$show		= $page->show();
		$list		= $push_model->limit($page->firstRow.','.$page->listRows)->where($where)->order('time desc')->select();
		$this->assign('list',$list);
		$this->assign('page',$show);
		$this->assign('search',$search);
		$this->display();
	}
	
}